package cn.gson.crm.model.pojos;

import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.Objects;

public class UserRolePK implements Serializable {
    private long yId;
    private long jId;

    @Column(name = "y_id")
    @Id
    public long getyId() {
        return yId;
    }

    public void setyId(long yId) {
        this.yId = yId;
    }

    @Column(name = "j_id")
    @Id
    public long getjId() {
        return jId;
    }

    public void setjId(long jId) {
        this.jId = jId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserRolePK that = (UserRolePK) o;
        return yId == that.yId &&
                jId == that.jId;
    }

    @Override
    public int hashCode() {
        return Objects.hash(yId, jId);
    }
}
